from django.urls import path
from .views import *

urlpatterns = [
    # 登录路径
    path('login', Login.as_view()),

    # 菜单权限列表
    path('menus',MenusModel.as_view()),
    # path('menus/<int:pk>',MenuModel.as_view()),

    #用户数据
    path('users', UserView.as_view({'get': 'list', 'post': 'create'})),
    path('users/<int:pk>', UserView.as_view({'get': 'retrieve', 'put': 'edit', 'delete': 'destroy'})),

    #岗位数据
    path('posts', PostView.as_view({'get': 'list', 'post': 'create'})),
    path('posts/<int:pk>', PostView.as_view({'get': 'retrieve', 'put': 'edit', 'delete': 'destroy'})),

     #部门数据
    path('departs', DepartView.as_view({'get': 'list', 'post': 'create'})),
    path('departs/<int:pk>', DepartView.as_view({'get': 'retrieve', 'put': 'edit', 'delete': 'destroy'})),

    #权限数据
    path('permissions', PermissView.as_view({'get': 'list', 'post': 'create'})),
    path('permissions/<int:pk>', PermissView.as_view({'get': 'retrieve', 'put': 'edit', 'delete': 'destroy'})),

     #角色数据
    path('roles', RoleView.as_view({'get': 'list', 'post': 'create'})),
    path('roles/<int:pk>', RoleView.as_view({'get': 'retrieve', 'put': 'edit', 'delete': 'destroy'})),
]
